#include "led.h"


	



void LED_Config(uint16_t LEDx)
{

	GPIO_InitTypeDef GPIO_InitStucture;
	RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOE, ENABLE);
	
	GPIO_InitStucture.GPIO_Mode = GPIO_Mode_OUT;
	GPIO_InitStucture.GPIO_OType = GPIO_OType_PP;
	GPIO_InitStucture.GPIO_Pin = LEDx;
	GPIO_InitStucture.GPIO_PuPd = GPIO_PuPd_NOPULL;
	GPIO_InitStucture.GPIO_Speed = GPIO_Speed_50MHz;
	
	GPIO_Init(GPIOE,&GPIO_InitStucture);

}


void Led_Config(void)
{
	unsigned int * add = GPIOE_RCC_Addr;
	* add |= 0x0010; 
	
	unsigned int * gpioe_mode_add = GPIOx_MODE_Addr;
	* gpioe_mode_add |= 0x00010000; 
	
	
	unsigned int * gpioe_otype_add = GPIOx_OTYPE_Addr;
	* gpioe_otype_add &=( ~(0x00000100)); 

	unsigned int * gpioe_speed_add = GPIOx_SPEED_Addr;
	* gpioe_speed_add &=( ~(0x00010000)); 
	
	unsigned int * gpioe_odr_add = GPIOx_ODR_Addr;
//	* gpioe_odr_add &=( ~(0x00000100)); 
	* gpioe_odr_add &=( 1<<8); 	
}